<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>消息列表</title>
    <link href="css/style.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="js/jquery.js"></script>


</head>


<body>
<form id="form1" runat="server" onsubmit="return false;">


    <div class="rightinfo">

        <ul class="seachform">
            <li><label>用户编号</label>
                <input type="text" class="scinput" id="txtUserName" th:value="${phone}"/></li>
                 <input type="hidden" id="hiddUserId" th:value="${user_id}" />

            <li><label>&nbsp;</label><input id="btnSearch" type="button" class="scbtn" value="查询"/></li>
        </ul>



        <table class="tablelist">
            <thead>
            <tr>
                <th width="50px"><input type="checkbox" id="chkSelectAll"/></th>
                <th width="50px">序号</th>
                <th width="100px">消息类型</th>
                <th width="300px">消息内容</th>
                <th width="200px">发送时间</th>
                <th width="100px">发送客户编号</th>
                <th width="80px">状态</th>
                <th>&nbsp;</th>
            </tr>
            </thead>
            <tbody>
            <tr th:each="meassge,iterStat : ${pageInfo.list}">
                <td><input type="checkbox" name="chkSelect" th:value="${meassge.id}"/></td>
                <td th:text="${iterStat.count}"></td>
                <td th:text="${meassge.title}"></td>
                <td th:text="${meassge.meassge_content}"></td>
                <td th:text="${#dates.format(meassge.create_time,'yyyy-MM-dd HH:mm:ss')}"></td>
                <td th:text="${userName}"></td>
                <td th:text="${meassge.is_read}=='1'?'已读':'未读'"></td>

                <td>&nbsp;</td>
            </tr>
            </tbody>
        </table>
        <div class='pagin' th:include="pagefoot::frag (${pageInfo},@{?1=1(phone=${phone},id=${user_id})})">
        </div>

    </div>

    <script type="text/javascript">
        $('.tablelist tbody tr:odd').addClass('odd');
    </script>

</form>


<link href="plugin/artDialog/artDialog/skins/blue.css" rel="stylesheet"/>
<script src="plugin/artDialog/artDialog/artDialog.min.js" type="text/javascript"></script>
<script src="plugin/artDialog/artDialog/artDialog.plugins.min.js" type="text/javascript"></script>
<script src="plugin/artDialog/dialog.js" type="text/javascript"></script>
<script type="text/javascript">
    /*<![CDATA[*/

    function getSelectedIds() {
        var items = $('input[name="chkSelect"]');
        var ids = new Array();
        for (var i = 0; i < items.length; i++) {
            if ($(items[i]).attr('checked')) {
                ids.push($(items[i]).val());
            }
        }

        return ids + '';
    }



    function search() {
        var userName = $('#txtUserName').val();
        var user_id = $('#hiddUserId').val();
        location.href = '?phone=' + userName+ '&id='+user_id  ;
    }

    $(function () {
        $('#chkSelectAll').click(function () {
            $('input[name="chkSelect"]').attr('checked', $('#chkSelectAll').attr('checked'));
        });


        $('#btnSearch').click(function () {
            search();
        });
    });
    /*]]>*/
</script>

</body>
</html>